#pragma once

#include <list>

class View;
class Cell;
class SkCanvas;

class Layout
{
public:
	Layout();
	virtual ~Layout();

	bool add(int index, View* view);
	bool add(int index, Layout* layout);

	virtual bool addColumn(unsigned int xInHundred) = 0;
	virtual bool addRow(unsigned int xInHundred) = 0;
	virtual bool addFixColumn(unsigned int xInHundred) = 0;
	virtual bool addFixRow(unsigned int xInHundred) = 0;

	bool remove(int index);

	bool onPaint(SkCanvas* pCanvas);

	virtual void updateLayout() = 0;

	void setRect(unsigned int x, unsigned int y, unsigned int width, unsigned int height);
	void getRect(unsigned int& x, unsigned int& y, unsigned int& width, unsigned int& height);

protected:
	std::list<Cell *> m_cells;
	unsigned int m_x;
	unsigned int m_y;
	unsigned int m_width;
	unsigned int m_height;

	int m_deno; // defined is 100
};

